﻿def hasExport():
    return bool(True)
def export(taps):
    with open('C:\Users\Public\Documents\wrkfil', 'w') as f:
        for s in taps:
            f.write(str(s))
            f.write('\n')
    f=open('C:\Users\Public\Documents\LConvADSP21xxabc.asm', 'w')
    f.write('/*-----------------------------------------------------------------------------\nThe program computes the convolution between two sequences x(n) and h(n) to \nproduce output sequence y(n).\n	Inputs: 1. Input Tap Sequence x(n) from wrkfil\n		2. Input Sample Sequence h(n) from ADC\n	Outputs: Output Sequence y(n).\n-----------------------------------------------------------------------------*/\n.MODULE conv;\n.CONST M=3;\n.CONST N=3;\n.VAR/DM/CIRC/ABS = 0x10 h(M)\n.VAR/DM/CIRC/ABS = 0x20 x[M+N-1];\n.VAR/DM/ABS      = 0x30 y[M+N-1];\n.INIT h:<wrkfil>;\n.INIT x:<X(n).dat>;\nJUMP start;\nstart: I0=^h+M-1;/*Initialise DAGs*/\n	L0=%h;\n	I1=^x;\n	L1=%x\n	I2=^y;\n	L2=0;\n	M0=-1;\n	M1=N;\n	M2=1;\n	/* Perform MAC- Convolution*/\n	ENA M_MODE;\n	CNTR=M+N-1;\n	DO loop1 UNTIL CE;\n	CNTR=M;\n	MR=0;\n	DO loop2 UNTIL CE;\n	MX0=DM(I0,M0);\n	MY0=DM(I1,M2);\nloop2: MR=MR+MX0*MY0(SS);\n	DM(I2,M2)=MR0;\nloop1: MODIFY(I1,M1);\n	.ENDMOD;\n')
    return